import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:opensource_download/core/supabase_client.dart';
import '../models/software.dart';
import '../repositories/software_repository.dart';

final softwareRepositoryProvider = Provider((ref) {
  return SoftwareRepository(SBClient.instance);
});

final softwareListProvider = FutureProvider.family<List<Software>, int?>((ref, categoryId) async {
  final repository = ref.watch(softwareRepositoryProvider);
  return repository.getSoftwareList(categoryId: categoryId);
});

final softwareDetailProvider = FutureProvider.family<Software, int>((ref, id) async {
  final repository = ref.watch(softwareRepositoryProvider);
  return repository.getSoftwareById(id);
}); 